﻿using System;
using System.Text;

namespace BizElements.Core
{
    /// <summary>
    /// An object that renders item as SQL element, clause or statement and appends the generated SQL code and parameters to shared output.
    /// </summary>
    public interface IRenderSql
    {
        /// <summary>
        /// Renders item as SQL element, clause or statement.
        /// </summary>
        /// <param name="dbms">Target DBMS.</param>
        /// <param name="output">Output StringBuilder to which SQL code is appended.</param>
        /// <param name="parameters">SQL parameter collection to which the object's and its children's
        /// parameters are added. After the rendering is done the collection contains all parameters with unique names.</param>
        void Render(DbmsType dbms, StringBuilder output, DbParameterCollection parameters);
    }
}